package three;

import java.util.NoSuchElementException;
import java.util.Scanner;

interface List {
    void add(int value);
    void remove(int index);
    void removeRange(int start, int end);
    void print();
}

class SinglyList implements List {
    class Node {
        int value;
        Node next;

        Node(int value) {
            this.value = value;
            this.next = null;
        }
    }

    Node head;
    int size;

    SinglyList() {
        this.head = null;
        this.size = 0;
    }

    public void add(int value) {
        Node node = new Node(value);
        if (head == null) {
            head = node;
        } else {
            Node p = head;
            while (p.next != null) {
                p = p.next;
            }
            p.next = node;
        }
        size++;
    }

    public void remove(int index) {
        if (index < 0 || index >= size) {
            throw new NoSuchElementException();
        }
        if (index == 0) {
            head = head.next;
        } else {
            Node p = head;
            for (int i = 0; i < index - 1; i++) {
                p = p.next;
            }
            p.next = p.next.next;
        }
        size--;
    }

    public void removeRange(int start, int end) {
        if (start > end || start < 0 || start >= size || end < 0 || end >= size) {
            throw new NoSuchElementException();
        }
        int count = end - start + 1;
        if (start == 0) {
            for (int i = 0; i < count; i++) {
                head = head.next;
            }
        } else {
            Node p = head;
            for (int i = 0; i < start - 1; i++) {
                p = p.next;
            }
            for (int i = 0; i < count; i++) {
                p.next = p.next.next;
            }
        }
        size -= count;
    }

    public void print() {
        Node p = head;
        while (p != null) {
            System.out.print(p.value + " ");
            p = p.next;
        }
        System.out.print(" ");
    }
}

public class Q {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt(); // 单链表元素个数

        SinglyList list = new SinglyList();
        for (int i = 0; i < n; i++) {
            list.add(scanner.nextInt()); // 读取单链表元素
        }

        int i = scanner.nextInt(); // 开始删除的位置
        int k = scanner.nextInt(); // 连续删除的元素个数

        // 判断删除的位置和元素个数是否有效
        if (i < 1 || i + k - 1 > n || k < 1) {
            System.out.println("输入的i或k位置有误");
            return;
        }

        // 删除元素
        list.removeRange(i - 1, i + k - 2);

        // 输出单链表
        list.print();
    }
}